Clearing Form Fields without initiating Validation Controls
Most validation controls will execute whenever any button on the form is clicked. This is problematic for a Clear button as you don't expect the data in the form fields to be valid (why else would the user be clearing it).
To override this behavior, simply add the following attribute to your button control:
This is the Default.aspx.cs file (ie: the code)
Below is the default.aspx file.
Clearing Form Fields without initiating Validation Controls
Most validation controls will execute whenever any button on the form is clicked. This is problematic for a Clear button as you don't expect the data in the form fields to be valid (why else would the user be clearing it).
To override this behavior, simply add the following attribute to your button control: